/*
 * Filename    : Grafik_Load.java
 * Projectname : RamaShinta
 * Date        : Nov 18, 2012 , 7:37:26 PM 
 * 
 * Class contain method for load Graphical Asset
 * 
 * Graphic_Load is Super Class for Graphical Package
 */

package com.amikomgamedev.ramashinta.graphic;

import java.util.ArrayList;

import org.andengine.engine.camera.Camera;
import org.andengine.engine.camera.hud.HUD;
import org.andengine.entity.primitive.Rectangle;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.sprite.AnimatedSprite;
import org.andengine.entity.sprite.TiledSprite;
import org.andengine.entity.sprite.ButtonSprite.OnClickListener;
import org.andengine.entity.sprite.Sprite;
import org.andengine.opengl.texture.TextureManager;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.buildable.builder.BlackPawnTextureAtlasBuilder;
import org.andengine.opengl.texture.region.TextureRegion;
import org.andengine.opengl.texture.region.TiledTextureRegion;
import org.andengine.opengl.vbo.VertexBufferObjectManager;
import org.andengine.ui.activity.BaseGameActivity;

import com.amikomgamedev.ramashinta.Utils;
import com.amikomgamedev.ramashinta.game.Game_Data;
import com.amikomgamedev.ramashinta.game.Game_Define;

import android.content.Context;

public class Graphic_Load implements Graphic_Data, Graphic_Path, Game_Data, Game_Define, Graphic_Anim
{

	protected BaseGameActivity				activity;
	protected Scene							m_Scene;
	protected HUD							m_Hud;
	protected Camera						m_Camera;
	protected OnClickListener				m_Click;

	protected BitmapTextureAtlas			_tex;
	protected TextureRegion					_reg;
	public Sprite							_spr;

	protected BitmapTextureAtlas			tex_Logo;
	protected BuildableBitmapTextureAtlas	build_logo;
	protected TextureRegion					reg_Logo;
	public Sprite							spr_Logo;

	public BitmapTextureAtlas				tex_Menu_Bg;
	protected TextureRegion					reg_Menu_Bg;
	public Sprite							spr_Menu_Bg;
	
	public BitmapTextureAtlas				tex_Gear;
	protected TextureRegion					reg_Gear;
	public Sprite							spr_Gear;
	
	public BitmapTextureAtlas				tex_Facebook;
	protected TextureRegion					reg_Facebook;
	public Sprite							spr_Facebook;
	
	public BitmapTextureAtlas				tex_Twitter;
	protected TextureRegion					reg_Twitter;
	public Sprite							spr_Twitter;

	protected BitmapTextureAtlas			tex_Credit_Bg;
	protected TextureRegion					reg_Credit_Bg;
	public Sprite							spr_Credit_Bg;

	public BitmapTextureAtlas				tex_Stage_Bg;
	protected TextureRegion					reg_Stage_Bg;
	public Sprite							spr_Stage_Bg;
	
	protected BitmapTextureAtlas[]			tex_Icon_Stage = new BitmapTextureAtlas[5];
	protected TextureRegion[]				reg_Icon_Stage = new TextureRegion[5];
	public Sprite[]							spr_Icon_Stage = new Sprite[5];

	protected BitmapTextureAtlas[][]		tex_Pointer = new BitmapTextureAtlas[2][5];
	protected TextureRegion[][]				reg_Pointer = new TextureRegion[2][5];
	public Sprite[][]						spr_Pointer = new Sprite[2][5];
	
	protected BitmapTextureAtlas			tex_Help_Bg;
	protected TextureRegion					reg_Help_Bg;
	public Sprite							spr_Help_Bg;

	protected BitmapTextureAtlas			tex_Loading_Bg;
	protected TextureRegion					reg_Loading_Bg;
	public Sprite							spr_Loading_Bg;

	// MENU STUFF
	protected BitmapTextureAtlas[]			tex_Button_Menu				= new BitmapTextureAtlas[BUTTON_MENU.length];
	protected TextureRegion[]				reg_Button_Menu				= new TextureRegion[BUTTON_MENU.length];
	public Sprite[]							spr_Button_Menu				= new Sprite[BUTTON_MENU.length];
	
	protected BitmapTextureAtlas[]			tex_Button_Menu_Pressed				= new BitmapTextureAtlas[BUTTON_MENU_PRESSED.length];
	protected TextureRegion[]				reg_Button_Menu_Pressed				= new TextureRegion[BUTTON_MENU_PRESSED.length];
	public Sprite[]							spr_Button_Menu_Pressed				= new Sprite[BUTTON_MENU_PRESSED.length];

	protected BitmapTextureAtlas			tex_Menu_Awanutama;
	protected TextureRegion					reg_Menu_Awanutama;
	public Sprite							spr_Menu_Awanutama;

	protected BitmapTextureAtlas			tex_Menu_Coklat;
	protected TextureRegion					reg_Menu_Coklat;
	public Sprite							spr_Menu_Coklat;

	protected BitmapTextureAtlas			tex_Menu_Level_Bg;
	protected TextureRegion					reg_Menu_Level_Bg;
	public Sprite							spr_Menu_Level_Bg;
	
	protected BitmapTextureAtlas			tex_Menu_Help_Bg;
	protected TextureRegion					reg_Menu_Help_Bg;
	public Sprite							spr_Menu_Help_Bg;

	protected BitmapTextureAtlas			tex_Menu_Level_Btn_Back;
	protected TextureRegion					reg_Menu_Level_Btn_Back;
	public Sprite							spr_Menu_Level_Btn_Back;

	protected BitmapTextureAtlas			tex_Menu_Level_Love;
	protected TextureRegion					reg_Menu_Level_Love;
	public Sprite[]							spr_Menu_Level_Love			= new Sprite[10];

	protected BitmapTextureAtlas			tex_Menu_Pause_Bg;
	protected TextureRegion					reg_Menu_Pause_Bg;
	public Sprite							spr_Menu_Pause_Bg;

	protected BitmapTextureAtlas			tex_Menu_Pause_Btn;
	protected TextureRegion					reg_Menu_Pause_Btn;
	public Sprite							spr_Menu_Pause_Btn;
	
	protected BitmapTextureAtlas			tex_Pause_Btn_Restart;
	protected TextureRegion					reg_Pause_Btn_Restart;
	public Sprite							spr_Pause_Btn_Restart;
	
	protected BitmapTextureAtlas			tex_Pause_Btn_Continue;
	protected TextureRegion					reg_Pause_Btn_Continue;
	public Sprite							spr_Pause_Btn_Continue;
	
	protected BitmapTextureAtlas			tex_Pause_Btn_MainMenu;
	protected TextureRegion					reg_Pause_Btn_MainMenu;
	public Sprite							spr_Pause_Btn_MainMenu;
	
	protected BitmapTextureAtlas			tex_Menu_Pause_BtnPressed;
	protected TextureRegion					reg_Menu_Pause_BtnPressed;
	public Sprite							spr_Menu_Pause_BtnPressed;

	// GAMEPLAY STUFF
	protected BitmapTextureAtlas[]			tex_Gameplay_bg				= new BitmapTextureAtlas[GAMEPLAY_BG.length];
	protected TextureRegion[]				reg_Gameplay_bg				= new TextureRegion[GAMEPLAY_BG.length];
	public Sprite							spr_Gameplay_bg;
	
	protected BitmapTextureAtlas[]			tex_Gameplay_Pf				= new BitmapTextureAtlas[GAMEPLAY_PLATFORM.length];
	protected TextureRegion[]				reg_Gameplay_Pf				= new TextureRegion[GAMEPLAY_PLATFORM.length];
	public Sprite[]							spr_Gameplay_Pf				= new Sprite[GAMEPLAY_PLATFORM.length];

	protected BitmapTextureAtlas[]			tex_Gameplay_Btn_Panah		= new BitmapTextureAtlas[GAMEPLAY_BTN_PANAH.length];
	protected TextureRegion[]				reg_Gameplay_Btn_Panah		= new TextureRegion[GAMEPLAY_BTN_PANAH.length];
	public Sprite[]							spr_Gameplay_Btn_Panah		= new Sprite[GAMEPLAY_BTN_PANAH.length];

	protected BitmapTextureAtlas[]			tex_Gameplay_Button_Move	= new BitmapTextureAtlas[GAMEPLAY_BUTTON_MOVE.length];
	protected TextureRegion[]				reg_Gameplay_Button_Move	= new TextureRegion[GAMEPLAY_BUTTON_MOVE.length];
	public Sprite[]							spr_Gameplay_Button_Move	= new Sprite[GAMEPLAY_BUTTON_MOVE.length];
	public Rectangle[]						rect_Gameplay				= new Rectangle[2];

	protected BitmapTextureAtlas			tex_Indikator_Bar;
	protected TextureRegion					reg_Indikator_Bar;
	public Sprite							spr_Indikator_Bar_kiri, spr_Indikator_Bar_kanan;

	protected BitmapTextureAtlas			tex_Mc_Rama;
	protected TiledTextureRegion			reg_Mc_Rama;
	public AnimatedSprite					spr_Mc_Rama;

	protected BitmapTextureAtlas			tex_Mc_Rahwana;
	protected TiledTextureRegion			reg_Mc_Rahwana;
	public AnimatedSprite					spr_Mc_Rahwana;
	
	protected BitmapTextureAtlas			tex_Celebrasi_Rahwana;
	protected TiledTextureRegion			reg_Celebrasi_Rahwana;
	public AnimatedSprite					spr_Celebrasi_Rahwana;
	
	protected BitmapTextureAtlas			tex_Celebrasi_Rama;
	protected TiledTextureRegion			reg_Celebrasi_Rama;
	public AnimatedSprite					spr_Celebrasi_Rama;

	protected BitmapTextureAtlas			tex_Mc_Shinta;
	protected TiledTextureRegion			reg_Mc_Shinta;
	public AnimatedSprite					spr_Mc_Shinta;
	public Rectangle						rect_BalokShinta;
	
	protected BitmapTextureAtlas			tex_Anim_Panah_Api;
	public TiledTextureRegion				reg_Anim_Panah_Api;
	public AnimatedSprite					spr_AnimPanahApi;
	
	protected BitmapTextureAtlas			tex_Kandang;
	public TextureRegion					reg_Kandang;
	public Sprite							spr_Kandang;

	// item
	protected BitmapTextureAtlas			tex_Item_Love;
	public TextureRegion					reg_Item_Love;
	public Sprite							spr_Item_Love;

	protected BitmapTextureAtlas			tex_Item_Choco;
	public TextureRegion					reg_Item_Choco;
	public Sprite							spr_Item_Choco;
	public Sprite							spr_Stat_ChocoRama;
	public Sprite							spr_Stat_ChocoRahwana;

	protected BitmapTextureAtlas			tex_Item_Racun;
	public TextureRegion					reg_Item_Racun;
	public Sprite							spr_Item_Racun;

	protected BitmapTextureAtlas			tex_Item_Rose;
	public TextureRegion					reg_Item_Rose;
	public Sprite							spr_Item_Rose;
	
	protected BitmapTextureAtlas			tex_Item_WingerHeart;
	public TiledTextureRegion				reg_Item_WingerHeart;
	public AnimatedSprite 					spr_Item_WingerHeart;
	
	protected BitmapTextureAtlas			tex_Item_Kayu;
	public TextureRegion					reg_Item_Kayu;
	public Sprite							spr_Item_Kayu;

	protected BitmapTextureAtlas			tex_Item_Batu;
	public TextureRegion					reg_Item_Batu;
	public Sprite							spr_Item_Batu;
	
	protected BitmapTextureAtlas			tex_Item_PoisonLQ;
	public TextureRegion					reg_Item_PoisonLQ;
	public Sprite							spr_Item_PoisonLQ;
	public Sprite[]							spr_Stat_PoisonLQ = new Sprite[2];
	
	protected BitmapTextureAtlas			tex_Item_BeeHive;
	public TextureRegion					reg_Item_BeeHive;
	public Sprite							spr_Item_BeeHive;
	public Sprite[]							spr_Stat_BeeHive = new Sprite[2];
	
	protected BitmapTextureAtlas			tex_Item_Metal;
	public TextureRegion					reg_Item_Metal;
	public Sprite							spr_Item_Metal;
	public Sprite[]							spr_Stat_Metal = new Sprite[2];
	
	protected BitmapTextureAtlas			tex_Item_Borgol;
	public TextureRegion					reg_Item_Borgol;
	public Sprite[]							spr_Stat_Borgol = new Sprite[2];
	
	protected BitmapTextureAtlas			tex_Item_Dumbell;
	public TextureRegion					reg_Item_Dumbell;
	public Sprite[]							spr_Stat_Dumbell = new Sprite[2];
	
	protected BitmapTextureAtlas			tex_Item_Boneka;
	public TextureRegion					reg_Item_Boneka;
	public Sprite							spr_Item_Boneka;
	public Sprite							spr_Stat_BonekaRama;
	public Sprite							spr_Stat_BonekaRahwana;
	
	protected BitmapTextureAtlas			tex_Item_Api;
	public TextureRegion					reg_Item_Api;
	public Sprite							spr_Item_Api;
	public Sprite							spr_Stat_ApiRama;
	public Sprite							spr_Stat_ApiRahwana;

	protected BitmapTextureAtlas			tex_Panah_Gameplay;
	public TextureRegion					reg_Panah_Gameplay;
	public Sprite							spr_Panah_Gameplay;
	
	protected BitmapTextureAtlas[]     	tex_Menu_Select_Stage	 = new BitmapTextureAtlas[MENU_SELECT_STAGE_BG.length];
	protected TextureRegion[]	  		reg_Menu_Select_Stage	 = new TextureRegion[MENU_SELECT_STAGE_BG.length];
	public Sprite[]		    			spr_Menu_Select_Stage	 = new Sprite[MENU_SELECT_STAGE_BG.length];
	 
	 protected BitmapTextureAtlas       tex_Menu_Lingkaran;
	 protected TiledTextureRegion       reg_Menu_Lingkaran;
	 public TiledSprite		 			spr_Menu_Lingkaran;
	 public ArrayList<TiledSprite>      lst_Menu_Stage_Lingkaran      = new ArrayList<TiledSprite>();
	    
	 
	 protected BitmapTextureAtlas       tex_Stage_Arrow;
	 protected TiledTextureRegion       reg_Stage_Arrow;
	 public TiledSprite[]		 		spr_Stage_Arrow = new TiledSprite[2];
	 
	 
	protected BitmapTextureAtlas			tex_Barrier;
	public TextureRegion					reg_Barrier;
	public Sprite							spr_BarrierRama;
	public Sprite							spr_BarrierRahwana;

	public BitmapTextureAtlas				tex_bar;
	public TextureRegion					reg_bar_1, reg_bar_2, reg_bar_3;
	public Sprite							spr_bar;
	
	// state WIN
		protected BitmapTextureAtlas			tex_Love_Win;
		protected TextureRegion					reg_Love_Win;
		public Sprite							spr_Love_Win;

		protected BitmapTextureAtlas			tex_Arrow_Win;
		protected TextureRegion					reg_Arrow_Win;
		public Sprite							spr_Arrow_Win;

		protected BitmapTextureAtlas			tex_Btn_TryNext_Win;
		protected TextureRegion					reg_Btn_TryNext_Win;
		public Sprite							spr_Btn_TryNext_Win;
		
		protected BitmapTextureAtlas			tex_Btn_Try_Win;
		protected TextureRegion					reg_Btn_Try_Win;
		public Sprite							spr_Btn_Try_Win;
		
		protected BitmapTextureAtlas			tex_Btn_Next_Win;
		protected TextureRegion					reg_Btn_Next_Win;
		public Sprite							spr_Btn_Next_Win;
	// state LOSE
		public BitmapTextureAtlas			tex_Love_Lose;
		protected TextureRegion					reg_Love_Lose;
		public Sprite							spr_Love_Lose;
	

	public Graphic_Load(Context contect, Scene p_Scene, HUD p_Hud, Camera p_Camera, OnClickListener p_Click)
	{
		activity = (BaseGameActivity) contect;
		m_Scene = p_Scene;
		m_Hud = p_Hud;
		m_Camera = p_Camera;
		m_Click = p_Click;
	}

	protected TextureManager getTextureManager()
	{
		return activity.getTextureManager();
	}

	protected VertexBufferObjectManager getVertexBufferManager()
	{
		return activity.getVertexBufferObjectManager();
	}

	public void loadLogo()
	{
		if (tex_Logo != null)
			return;

		tex_Logo = new BitmapTextureAtlas(getTextureManager(), LOGO_TEX_WIDTH, LOGO_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Logo = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Logo, activity, LOGO, 0, 0);
		tex_Logo.load();
	}

	public void loadCreditBg()
	{
		if (tex_Credit_Bg != null)
			return;
		tex_Credit_Bg = new BitmapTextureAtlas(getTextureManager(), CREDIT_BG_TEX_WIDTH, CREDIT_BG_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Credit_Bg = BitmapTextureAtlasTextureRegionFactory
				.createFromAsset(tex_Credit_Bg, activity, CREDIT_BG, 0, 0);
		tex_Credit_Bg.load();
		Utils.TRACE("Loadss Credit BG");
	}

	public void loadHelpBg()
	{
		if (tex_Help_Bg != null)
			return;
		tex_Help_Bg = new BitmapTextureAtlas(getTextureManager(), HELP_BG_TEX_WIDTH, HELP_BG_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Help_Bg = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Help_Bg, activity, HELP_BG, 0, 0);
		tex_Help_Bg.load();
		Utils.TRACE("Loadss Help BG");
	}
	
	public void loadGear()
	{
		if (tex_Gear != null)
			return;
		tex_Gear = new BitmapTextureAtlas(getTextureManager(), GEAR_TEX_WIDTH, GEAR_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Gear = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Gear, activity, MENU_CUPCORN_GEAR, 0, 0);
		tex_Gear.load();
		Utils.TRACE("Loadss Help BG");
	}
	
	 public void loadMenuSelectStage()
	    {
		for (int i = 0; i < MENU_SELECT_STAGE_BG.length; i++)
		{
		    if (tex_Menu_Select_Stage[i] != null)
			return;

		    tex_Menu_Select_Stage[i] = new BitmapTextureAtlas(
			    getTextureManager(),
			    MENU_SELECT_STAGE_TEX_WIDTH,
			    MENU_SELECT_STAGE_TEX_HEIGHT,
			    Utils.getTextureOption());
		    reg_Menu_Select_Stage[i] = BitmapTextureAtlasTextureRegionFactory
			    .createFromAsset(
				    tex_Menu_Select_Stage[i],
				    activity,
				    MENU_SELECT_STAGE_BG[i],
				    0,
				    0);
		    tex_Menu_Select_Stage[i].load();

		}}
	 
	 public void loadMenuLingkaran()
	    {
		if (tex_Menu_Lingkaran != null)
		    return;

		tex_Menu_Lingkaran = new BitmapTextureAtlas(
			getTextureManager(),
			MENU_SELECT_LINGKARAN_TEX_WIDTH,
			MENU_SELECT_LINGKARAN_TEX_HEIGHT,
			Utils.getTextureOption());

		reg_Menu_Lingkaran = BitmapTextureAtlasTextureRegionFactory
			.createTiledFromAsset(
				tex_Menu_Lingkaran,
				activity,
				MENU_LINGKARAN,
				0,
				0,
				MENU_SELECT_LINGKARAN_COLUMN,
				MENU_SELECT_LINGKARAN_ROW);

		tex_Menu_Lingkaran.load();
	    }
	 
	 public void loadStageArrow()
	    {
		if (tex_Stage_Arrow != null)
		    return;

		tex_Stage_Arrow = new BitmapTextureAtlas(
			getTextureManager(),
			STAGE_ARROW_TEX_WIDTH,
			STAGE_ARROW_TEX_HEIGHT,
			Utils.getTextureOption());

		reg_Stage_Arrow = BitmapTextureAtlasTextureRegionFactory
			.createTiledFromAsset(
				tex_Stage_Arrow,
				activity,
				ARROW_STAGE	,
				0,
				0,
				STAGE_ARROW_COLUMN,
				STAGE_ARROW_ROW);

		tex_Stage_Arrow.load();
	    }
	 public void loadArrowStage()
	    {
		if (tex_Menu_Lingkaran != null)
		    return;

		tex_Menu_Lingkaran = new BitmapTextureAtlas(
			getTextureManager(),
			MENU_SELECT_LINGKARAN_TEX_WIDTH,
			MENU_SELECT_LINGKARAN_TEX_HEIGHT,
			Utils.getTextureOption());

		reg_Menu_Lingkaran = BitmapTextureAtlasTextureRegionFactory
			.createTiledFromAsset(
				tex_Menu_Lingkaran,
				activity,
				MENU_LINGKARAN,
				0,
				0,
				MENU_SELECT_LINGKARAN_COLUMN,
				MENU_SELECT_LINGKARAN_ROW);

		tex_Menu_Lingkaran.load();
	    }
	public void loadFacebook()
	{
		if (tex_Facebook != null)
			return;
		tex_Facebook = new BitmapTextureAtlas(getTextureManager(), GEAR_TEX_WIDTH, GEAR_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Facebook = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Facebook, activity, MENU_FACEBOOK_GEAR, 0, 0);
		tex_Facebook.load();
	}
	
	public void loadTwitter()
	{
		if (tex_Twitter != null)
			return;
		tex_Twitter = new BitmapTextureAtlas(getTextureManager(), GEAR_TEX_WIDTH, GEAR_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Twitter = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Twitter, activity, MENU_TWITTER_GEAR, 0, 0);
		tex_Twitter.load();
	}

	public void loadLoadingBg()
	{
		if (tex_Loading_Bg != null)
			return;
		tex_Loading_Bg = new BitmapTextureAtlas(getTextureManager(), LOADING_BG_TEX_WIDTH, LOADING_BG_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Loading_Bg = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Loading_Bg, activity,
				LOADING_SCREEN_BG, 0, 0);
		tex_Loading_Bg.load();
		Utils.TRACE("Loadss Loading Screen");
	}

	public void loadMenu()
	{
		loadMenuBg();
		loadButtonMenu();
		loadCoklatCupcorn();
		loadGear();
		loadFacebook();
		loadTwitter();
		loadButtonMenuPressed();
	}

	public void loadMenuLevel()
	{
		loadMenuLevelBg();
		loadMenuLevelBtnBack();
		loadMenuLevelLove();

	}

	public void loadMenuStage()
	{
//		BAckground
		if (tex_Stage_Bg != null)
			return;
		tex_Stage_Bg = new BitmapTextureAtlas(getTextureManager(), MENU_STAGE_BG_TEX_W,
				MENU_STAGE_BG_TEX_H, Utils.getTextureOption());
		reg_Stage_Bg = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Stage_Bg, activity,
				MENU_STAGE_BG, 0, 0);
		tex_Stage_Bg.load();
		
//		Icon Stage
		for(int i=0; i < 5; i++)
		{
			if(tex_Icon_Stage[i] !=null)
				return;
			
			tex_Icon_Stage[i] = new BitmapTextureAtlas(getTextureManager(), MENU_STAGE_ICON_TEX_W,
					MENU_STAGE_ICON_TEX_H, Utils.getTextureOption());
			reg_Icon_Stage[i] = BitmapTextureAtlasTextureRegionFactory
					.createFromAsset(tex_Icon_Stage[i], activity, MENU_STAGE_ICON[i], 0, 0);
			tex_Icon_Stage[i].load();
		}
		
//		Pointer
		for(int i=0; i < 2; i++)
		{
			for(int j=0; j < 5; j++)
			{
				if(tex_Pointer[i][j] != null)
					return;
				
				if(i==0)
				{
					tex_Pointer[i][j] = new BitmapTextureAtlas(getTextureManager(), MENU_STAGE_POINTER_TEX_W, 
							MENU_STAGE_POINTER_TEX_H, Utils.getTextureOption());
					reg_Pointer[i][j] = BitmapTextureAtlasTextureRegionFactory
							.createFromAsset(tex_Pointer[i][j], activity, POINTER_BLACK, 0, 0);
					tex_Pointer[i][j].load();
				}
				else
				{
					tex_Pointer[i][j] = new BitmapTextureAtlas(getTextureManager(), MENU_STAGE_POINTER_TEX_W, 
							MENU_STAGE_POINTER_TEX_H, Utils.getTextureOption());
					reg_Pointer[i][j] = BitmapTextureAtlasTextureRegionFactory
							.createFromAsset(tex_Pointer[i][j], activity, POINTER_WHITE, 0, 0);
					tex_Pointer[i][j].load();
				}
			}
		}
		
	}
	
	public void loadMenuPause()
	{
		loadMenuPauseBg();
		loadPauseContinue();
		loadPauseRestart();
		loadPauseMainmenu();
		loadMenuPauseBtn();
		loadMenuPauseBtnPressed();
	}
	
	private void loadMenuPauseBtnPressed()
	{
		if (tex_Menu_Pause_BtnPressed != null)
			return;
		tex_Menu_Pause_BtnPressed = new BitmapTextureAtlas(getTextureManager(), MENU_PAUSE_BTNPRESSED_TEX_WIDTH,
				MENU_PAUSE_BTNPRESSED_TEX_HEIGHT, Utils.getTextureOption());
		reg_Menu_Pause_BtnPressed = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Menu_Pause_BtnPressed, activity,
				MENU_PAUSE_BTNPRESSED, 0, 0);
		tex_Menu_Pause_BtnPressed.load();
		Utils.TRACE("Loadsss pause btn");

	}

	public void loadGamePlay()
	{
		loadGameplayBg();
		loadIndikatorBar();
		loadMcShinta();
		loadButtonPanah();
		loadButtonMove();
		loadMcRama();
		loadMcRahwana();
		loadItemLove();
		loadItemRacun();
		loadItemChoco();
		loadItemKayu();
		loadItemBatu();
		loadItemBoneka();
		loadItemPoisonLQ();
		loadItemRose();
		loadItemWingerHeart();
		loadItemBeeHive();
		loadItemBorgol();
		loadItemDumbell();
		loadItemMetal();
		loadItemApi();
		loadPanahGameplay();
		loadBarrier();
		
		loadAnimPanahApi();
		loadKandang();
		loadGameplayPf();

//		loadBar();
		loadCelebrasiRahwana();
		loadCelebrasiRama();

	}

	public void loadStateWin()
	{
		loadLoveWin();
		loadArrowWin();
		loadBtnTryWin();
		loadBtnTry();
		loadBtnNext();
	}
	
	public void loadStateLose()
	{
		loadLoveLose();
	}
	
	public void loadStateHelp()
	{
		loadMenuHelpBg();
	}
	
	private void loadLoveLose()
	{
		if (tex_Love_Lose != null)
			return;
		tex_Love_Lose = new BitmapTextureAtlas(getTextureManager(), LOVE_LOSE_TEX_WIDTH, LOVE_LOSE_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Love_Lose = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Love_Lose, activity, LOVE_LOSE, 0, 0);
		tex_Love_Lose.load();
		Utils.TRACE("Loadsss love lose ");

	}

	private void loadBtnTryWin()
	{
		if (tex_Btn_TryNext_Win != null)
			return;
		tex_Btn_TryNext_Win = new BitmapTextureAtlas(getTextureManager(), BTN_TRY_WIN_TEX_WIDTH, BTN_TRY_WIN_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Btn_TryNext_Win = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Btn_TryNext_Win, activity,
				BTN_TRY_NEXT_WIN, 0, 0);
		tex_Btn_TryNext_Win.load();
		Utils.TRACE("Loadsss btn try win");

	}
	
	private void loadBtnTry()
	{
		if (tex_Btn_Try_Win != null)
			return;
		tex_Btn_Try_Win = new BitmapTextureAtlas(getTextureManager(), BTN_TRY_TEX_WIDTH, BTN_TRY_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Btn_Try_Win = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Btn_Try_Win, activity,
				BTN_TRY_WIN, 0, 0);
		tex_Btn_Try_Win.load();
		Utils.TRACE("Loadsss btn try win");

	}
	
	private void loadBtnNext()
	{
		if (tex_Btn_Next_Win != null)
			return;
		tex_Btn_Next_Win = new BitmapTextureAtlas(getTextureManager(), BTN_NEXT_TEX_WIDTH, BTN_NEXT_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Btn_Next_Win = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Btn_Next_Win, activity,
				BTN_NEXT_WIN, 0, 0);
		tex_Btn_Next_Win.load();
		Utils.TRACE("Loadsss btn try win");

	}

	private void loadArrowWin()
	{
		if (tex_Arrow_Win != null)
			return;
		tex_Arrow_Win = new BitmapTextureAtlas(getTextureManager(), ARROW_WIN_TEX_WIDTH, ARROW_WIN_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Arrow_Win = BitmapTextureAtlasTextureRegionFactory
				.createFromAsset(tex_Arrow_Win, activity, ARROW_WIN, 0, 0);
		tex_Arrow_Win.load();
		Utils.TRACE("Loadsss arrow win");

	}

	private void loadLoveWin()
	{
		if (tex_Love_Win != null)
			return;
		tex_Love_Win = new BitmapTextureAtlas(getTextureManager(), LOVE_WIN_TEX_WIDTH, LOVE_WIN_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Love_Win = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Love_Win, activity, LOVE_WIN, 0, 0);
		tex_Love_Win.load();
		Utils.TRACE("Loadsss love win ");

	}


	private void loadMenuPauseBtn()
	{
		if (tex_Menu_Pause_Btn != null)
			return;
		tex_Menu_Pause_Btn = new BitmapTextureAtlas(getTextureManager(), MENU_PAUSE_BTN_TEX_WIDTH,
				MENU_PAUSE_BTN_TEX_HEIGHT, Utils.getTextureOption());
		reg_Menu_Pause_Btn = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Menu_Pause_Btn, activity,
				MENU_PAUSE_BTN, 0, 0);
		tex_Menu_Pause_Btn.load();
		Utils.TRACE("Loadsss pause btn");

	}

	private void loadMenuPauseBg()
	{
		if (tex_Menu_Pause_Bg != null)
			return;
		tex_Menu_Pause_Bg = new BitmapTextureAtlas(getTextureManager(), MENU_PAUSE_BG_TEX_WIDTH,
				MENU_PAUSE_BG_TEX_WIDTH, Utils.getTextureOption());
		reg_Menu_Pause_Bg = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Menu_Pause_Bg, activity,
				MENU_PAUSE_BG, 0, 0);
		tex_Menu_Pause_Bg.load();
		Utils.TRACE("Loadsss pause bg");

	}
	
	private void loadPauseRestart()
	{
		if (tex_Pause_Btn_Restart != null)
			return;
		tex_Pause_Btn_Restart = new BitmapTextureAtlas(getTextureManager(), PAUSE_BTN_TEX_WIDTH,
				PAUSE_BTN_TEX_HEIGHT, Utils.getTextureOption());
		reg_Pause_Btn_Restart = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Pause_Btn_Restart, activity,
				MENU_RESTART_BTN, 0, 0);
		tex_Pause_Btn_Restart.load();

	}
	
	private void loadPauseContinue()
	{
		if (tex_Pause_Btn_Continue != null)
			return;
		tex_Pause_Btn_Continue = new BitmapTextureAtlas(getTextureManager(), PAUSE_BTN_TEX_WIDTH,
				PAUSE_BTN_TEX_HEIGHT, Utils.getTextureOption());
		reg_Pause_Btn_Continue = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Pause_Btn_Continue, activity,
				MENU_CONTINUE_BTN, 0, 0);
		tex_Pause_Btn_Continue.load();

	}
	
	private void loadPauseMainmenu()
	{
		if (tex_Pause_Btn_MainMenu != null)
			return;
		tex_Pause_Btn_MainMenu = new BitmapTextureAtlas(getTextureManager(), PAUSE_BTN_TEX_WIDTH,
				PAUSE_BTN_TEX_HEIGHT, Utils.getTextureOption());
		reg_Pause_Btn_MainMenu = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Pause_Btn_MainMenu, activity,
				MENU_MAINMENU_BTN, 0, 0);
		tex_Pause_Btn_MainMenu.load();

	}

	private void loadMenuLevelLove()
	{
		if (tex_Menu_Level_Love != null)
			return;
		tex_Menu_Level_Love = new BitmapTextureAtlas(getTextureManager(), MENU_LEVEL_LOVE_TEX_WIDTH,
				MENU_LEVEL_LOVE_TEX_HEIGHT, Utils.getTextureOption());
		reg_Menu_Level_Love = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Menu_Level_Love, activity,
				MENU_LEVEL_LOVE, 0, 0);
		tex_Menu_Level_Love.load();

	}

	private void loadMenuLevelBtnBack()
	{
		if (tex_Menu_Level_Btn_Back != null)
			return;
		tex_Menu_Level_Btn_Back = new BitmapTextureAtlas(getTextureManager(), MENU_LEVEL_BTN_BACK_TEX_WIDTH,
				MENU_LEVEL_BTN_BACK_TEX_HEIGHT, Utils.getTextureOption());
		reg_Menu_Level_Btn_Back = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Menu_Level_Btn_Back,
				activity, MENU_LEVEL_BACK, 0, 0);
		tex_Menu_Level_Btn_Back.load();
	}

	private void loadMenuLevelBg()
	{
		if (tex_Menu_Level_Bg != null)
			return;
		tex_Menu_Level_Bg = new BitmapTextureAtlas(getTextureManager(), MENU_LEVEL_BG_TEX_WIDTH,
				MENU_LEVEL_BG_TEX_HEIGHT, Utils.getTextureOption());
		reg_Menu_Level_Bg = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Menu_Level_Bg, activity,
				MENU_LEVEL_SELECT_BG, 0, 0);
		tex_Menu_Level_Bg.load();
	}

	private void loadMenuHelpBg()
	{
		if (tex_Menu_Help_Bg != null)
			return;
		tex_Menu_Help_Bg = new BitmapTextureAtlas(getTextureManager(), HELP_BG_TEX_WIDTH,
				HELP_BG_TEX_HEIGHT, Utils.getTextureOption());
		reg_Menu_Help_Bg = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Menu_Help_Bg, activity,
				HELP_BG, 0, 0);
		tex_Menu_Help_Bg.load();
	}
	
	private void loadPanahGameplay()
	{
		if (tex_Panah_Gameplay != null)
			return;
		tex_Panah_Gameplay = new BitmapTextureAtlas(getTextureManager(), PANAH_GAMEPLAY_TEX_WIDTH,
				PANAH_GAMEPLAY_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Panah_Gameplay = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Panah_Gameplay, activity,
				panah,
				0, 0);
		tex_Panah_Gameplay.load();

	}
	
	private void loadBarrier()
	{
		if (tex_Barrier != null)
			return;
		tex_Barrier = new BitmapTextureAtlas(getTextureManager(), BARRIER_TEX_WIDTH,
				BARRIER_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Barrier = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Barrier, activity,
				barrier,
				0, 0);
		tex_Barrier.load();

	}
	
	private void loadItemApi()
	{
		if (tex_Item_Api != null)
			return;
		tex_Item_Api = new BitmapTextureAtlas(getTextureManager(), ITEM_API_TEX_WIDTH, ITEM_API_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_Api = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_Api, activity,
				ITEM_API,
				0, 0);
		tex_Item_Api.load();

	}

	private void loadItemBoneka()
	{
		if (tex_Item_Boneka != null)
			return;
		tex_Item_Boneka = new BitmapTextureAtlas(getTextureManager(), ITEM_BONEKA_TEX_WIDTH, ITEM_BONEKA_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_Boneka = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_Boneka, activity,
				ITEM_BONEKA,
				0, 0);
		tex_Item_Boneka.load();

	}
	private void loadItemPoisonLQ()
	{
		if (tex_Item_PoisonLQ != null)
			return;
		tex_Item_PoisonLQ = new BitmapTextureAtlas(getTextureManager(), ITEM_POISONLQD_TEX_WIDTH, ITEM_POISONLQD_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_PoisonLQ = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_PoisonLQ, activity,
				ITEM_POISONLQ,
				0, 0);
		tex_Item_PoisonLQ.load();

	}
	private void loadItemBatu()
	{
		if (tex_Item_Batu != null)
			return;
		tex_Item_Batu = new BitmapTextureAtlas(getTextureManager(), ITEM_BATU_TEX_WIDTH, ITEM_BATU_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_Batu = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_Batu, activity, ITEM_BATU,
				0, 0);
		tex_Item_Batu.load();
	}
	
	private void loadItemBeeHive()
	{
		if (tex_Item_BeeHive != null)
			return;
		tex_Item_BeeHive = new BitmapTextureAtlas(getTextureManager(), ITEM_BEEHIVE_TEX_WIDTH, ITEM_BEEHIVE_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_BeeHive = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_BeeHive, activity,
				ITEM_BEEHIVE,
				0, 0);
		tex_Item_BeeHive.load();

	}
	
	private void loadItemMetal()
	{
		if (tex_Item_Metal != null)
			return;
		tex_Item_Metal = new BitmapTextureAtlas(getTextureManager(), ITEM_METAL_TEX_WIDTH, ITEM_METAL_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_Metal = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_Metal, activity,
				ITEM_METAL,
				0, 0);
		tex_Item_Metal.load();

	}
	
	
	private void loadItemBorgol()
	{
		if (tex_Item_Borgol != null)
			return;
		tex_Item_Borgol = new BitmapTextureAtlas(getTextureManager(), ITEM_BORGOL_TEX_WIDTH, ITEM_BORGOL_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_Borgol = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_Borgol, activity,
				ITEM_BORGOL,
				0, 0);
		tex_Item_Borgol.load();

	}
	
	private void loadItemDumbell()
	{
		if (tex_Item_Dumbell != null)
			return;
		tex_Item_Dumbell = new BitmapTextureAtlas(getTextureManager(), ITEM_DUMBELL_TEX_WIDTH, ITEM_DUMBELL_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_Dumbell = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_Dumbell, activity,
				ITEM_DUMBELL,
				0, 0);
		tex_Item_Dumbell.load();

	}
	
	
	
	private void loadItemKayu()
	{
		if (tex_Item_Kayu != null)
			return;
		tex_Item_Kayu = new BitmapTextureAtlas(getTextureManager(), ITEM_KAYU_TEX_WIDTH, ITEM_KAYU_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_Kayu = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_Kayu, activity, ITEM_KAYU,
				0, 0);
		tex_Item_Kayu.load();

	}

	private void loadItemRacun()
	{
		if (tex_Item_Racun != null)
			return;
		tex_Item_Racun = new BitmapTextureAtlas(getTextureManager(), ITEM_RACUN_TEX_WIDTH, ITEM_RACUN_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_Racun = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_Racun, activity, ITEM_RACUN,
				0, 0);
		tex_Item_Racun.load();
	}
		
	private void loadItemRose()
	{
		if (tex_Item_Rose != null)
			return;
		tex_Item_Rose = new BitmapTextureAtlas(getTextureManager(), ITEM_ROSE_TEX_WIDTH, ITEM_ROSE_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_Rose= BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_Rose, activity, ITEM_ROSE,
				0, 0);
		tex_Item_Rose.load();

	}

	private void loadItemWingerHeart()
	{
		if (tex_Item_WingerHeart != null)
			return;
		tex_Item_WingerHeart = new BitmapTextureAtlas(getTextureManager(), ITEM_WINGER_HEART_TEX_WIDTH, ITEM_WINGER_HEART_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_WingerHeart= BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(tex_Item_WingerHeart, activity,
				ITEM_WINGER_HEART,
				0, 0, 4, 1);
		tex_Item_WingerHeart.load();

	}

	private void loadItemChoco()
	{
		if (tex_Item_Choco != null)
			return;
		tex_Item_Choco = new BitmapTextureAtlas(getTextureManager(), ITEM_CHOCO_TEX_WIDTH, ITEM_CHOCO_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_Choco = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Item_Choco, activity, ITEM_CHOCO,
				0, 0);
		tex_Item_Choco.load();

	}

	private void loadItemLove()
	{
		if (tex_Item_Love != null)
			return;
		tex_Item_Love = new BitmapTextureAtlas(getTextureManager(), ITEM_LOVE_TEX_WIDTH, ITEM_LOVE_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Item_Love = BitmapTextureAtlasTextureRegionFactory
				.createFromAsset(tex_Item_Love, activity, ITEM_LOVE, 0, 0);
		tex_Item_Love.load();

	}
	
	private void loadKandang()
	{
		if (tex_Kandang != null)
			return;
		tex_Kandang = new BitmapTextureAtlas(getTextureManager(), GAMEPLAY_KANDANG_TEX_WIDTH, GAMEPLAY_KANDANG_TEX_HIEGHT,
				Utils.getTextureOption());
		reg_Kandang = BitmapTextureAtlasTextureRegionFactory
				.createFromAsset(tex_Kandang, activity, SPR_KANDANG, 0, 0);
		tex_Kandang.load();

	}

	private void loadBar()
	{
		if (tex_bar != null)
			return;
		tex_bar = new BitmapTextureAtlas(getTextureManager(), ITEM_BAR_TEX_WIDTH, ITEM_BAR_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_bar_1 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_bar, activity, BAR_1, 0, 0);
		reg_bar_2 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_bar, activity, BAR_2, 0, 0);
		reg_bar_3 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_bar, activity, BAR_3, 0, 0);
		tex_bar.load();

	}

	private void loadMenuBg()
	{
		if (tex_Menu_Bg != null)
			return;

		tex_Menu_Bg = new BitmapTextureAtlas(getTextureManager(), MENU_BG_TEX_WIDTH, MENU_BG_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Menu_Bg = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Menu_Bg, activity, MENU_BACKGROUND, 0,
				0);
		tex_Menu_Bg.load();
		Utils.TRACE("Loadss Menu BG");
	}

	private void loadButtonMenu()
	{
		for (int i = 0; i < BUTTON_MENU.length; i++)
		{
			if (tex_Button_Menu[i] != null)
				return;
			tex_Button_Menu[i] = new BitmapTextureAtlas(getTextureManager(), MENU_BUTTON_TEX_WIDTH,
					MENU_BUTTON_TEX_HEIGHT, Utils.getTextureOption());
			reg_Button_Menu[i] = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Button_Menu[i], activity,
					BUTTON_MENU[i], 0, 0);
			tex_Button_Menu[i].load();
			Utils.TRACE("Loadss Button Menu :" + (i + 1));
		}
	}
	
	private void loadButtonMenuPressed()
	{
		for (int i = 0; i < BUTTON_MENU_PRESSED.length; i++)
		{
			if (tex_Button_Menu_Pressed[i] != null)
				return;
			tex_Button_Menu_Pressed[i] = new BitmapTextureAtlas(getTextureManager(), MENU_BUTTON_TEX_WIDTH,
					MENU_BUTTON_TEX_HEIGHT, Utils.getTextureOption());
			reg_Button_Menu_Pressed[i] = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Button_Menu_Pressed[i], activity,
					BUTTON_MENU_PRESSED[i], 0, 0);
			tex_Button_Menu_Pressed[i].load();
			Utils.TRACE("Loadss Button Menu :" + (i + 1));
		}
	}
	
	private void loadCoklatCupcorn()
	{
		if (tex_Menu_Coklat != null)
			return;
		tex_Menu_Coklat = new BitmapTextureAtlas(getTextureManager(), MENU_COKLAT_TEX_WIDTH,
				MENU_COKLAT_TEX_HEIGHT, Utils.getTextureOption());
		reg_Menu_Coklat = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Menu_Coklat, activity,
				MENU_COKLAT, 0, 0);
		tex_Menu_Coklat.load();
		Utils.TRACE("Loadss BorderAwan");
	}

	private void loadGameplayBg()
	{
		for (int i = 0; i < GAMEPLAY_BG.length; i++)
		{
			tex_Gameplay_bg[i] = new BitmapTextureAtlas(getTextureManager(),
					GAMEPLAY_BG_TEX_WIDTH, GAMEPLAY_BG_TEX_HIEGHT,
					Utils.getTextureOption());

			reg_Gameplay_bg[i] = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Gameplay_bg[i],
					activity, GAMEPLAY_BG[i], 0, 0);
			tex_Gameplay_bg[i].load();

			Utils.TRACE("Loadsss Gameplay BG 1");
		}
	}
	
	private void loadGameplayPf()
	{
		for (int i = 0; i < GAMEPLAY_PLATFORM.length; i++)
		{
			tex_Gameplay_Pf[i] = new BitmapTextureAtlas(getTextureManager(),
					GAMEPLAY_PF_TEX_WIDTH, GAMEPLAY_PF_TEX_HIEGHT,
					Utils.getTextureOption());

			reg_Gameplay_Pf[i] = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Gameplay_Pf[i],
					activity, GAMEPLAY_PLATFORM[i], 0, 0);
			tex_Gameplay_Pf[i].load();
		}
	}

	private void loadIndikatorBar()
	{
		if (tex_Indikator_Bar != null)
			return;
		tex_Indikator_Bar = new BitmapTextureAtlas(getTextureManager(), GAMEPLAY_INDIKATOR_BAR_TEX_WIDTH,
				GAMEPLAY_INDIKATOR_BAR_TEX_HEIGHT, Utils.getTextureOption());
		reg_Indikator_Bar = BitmapTextureAtlasTextureRegionFactory.createFromAsset(tex_Indikator_Bar, activity,
				INDIKATOR_BAR, 0, 0);
		tex_Indikator_Bar.load();
		Utils.TRACE("Loadss Indikator bar");
	}

	private void loadMcShinta()
	{
		if (tex_Mc_Shinta != null)
			return;
		tex_Mc_Shinta = new BitmapTextureAtlas(getTextureManager(), SPR_MC_SHINTA_TEX_WIDTH, SPR_MC_SHINTA_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Mc_Shinta = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(tex_Mc_Shinta, activity,
				SPR_MC_SHINTA, 0, 0, SPR_MC_SHINTA_COLUMN, SPR_MC_SHINTA_ROW);
		tex_Mc_Shinta.load();
	}
	
	private void loadAnimPanahApi()
	{
		if (tex_Anim_Panah_Api != null)
			return;
		tex_Anim_Panah_Api = new BitmapTextureAtlas(getTextureManager(), SPR_PANAH_API_TEX_WIDTH, SPR_PANAH_API_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Anim_Panah_Api = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(tex_Anim_Panah_Api, activity,
				SPR_PANAH_API, 0, 0, SPR_PANAH_API_COLUMN, SPR_PANAH_API_ROW);
		tex_Anim_Panah_Api.load();
	}

	private void loadButtonPanah()
	{
		for (int i = 0; i < GAMEPLAY_BTN_PANAH.length; i++)
		{
			tex_Gameplay_Btn_Panah[i] = new BitmapTextureAtlas(getTextureManager(), GAMEPLAY_BTN_PANAH_TEX_WIDTH,
					GAMEPLAY_BTN_PANAH_TEX_HEIGHT, Utils.getTextureOption());
			reg_Gameplay_Btn_Panah[i] = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
					tex_Gameplay_Btn_Panah[i], activity, GAMEPLAY_BTN_PANAH[i], 0, 0);
			tex_Gameplay_Btn_Panah[i].load();
			Utils.TRACE("Loadss button panah " + i);
		}
	}

	private void loadButtonMove()
	{
		for (int i = 0; i < GAMEPLAY_BUTTON_MOVE.length; i++)
		{
			if (tex_Gameplay_Button_Move[i] != null)
				return;
			tex_Gameplay_Button_Move[i] = new BitmapTextureAtlas(getTextureManager(), GAMEPLAY_BTN_MOVE_TEX_WIDTH,
					GAMEPLAY_BTN_MOVE_TEX_HEIGHT, Utils.getTextureOption());
			reg_Gameplay_Button_Move[i] = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
					tex_Gameplay_Button_Move[i], activity, GAMEPLAY_BUTTON_MOVE[i], 0, 0);
			tex_Gameplay_Button_Move[i].load();
			Utils.TRACE("Loadss Button move " + i);
		}
	}

	private void loadMcRama()
	{
		if (tex_Mc_Rama != null)
			return;
		tex_Mc_Rama = new BitmapTextureAtlas(getTextureManager(), SPR_MC_RAMA_TEX_WIDTH, SPR_MC_RAMA_TEX_HEIGHT,
				Utils.getTextureOption());
		reg_Mc_Rama = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(tex_Mc_Rama, activity, SPR_MC_RAMA,
				0, 0, SPR_MC_RAMA_COLUMN, SPR_MC_RAMA_ROW);
		Utils.TRACE("Loadss MC Rama");
		tex_Mc_Rama.load();
	}

	private void loadMcRahwana()
	{
		if (tex_Mc_Rahwana != null)
			return;
		tex_Mc_Rahwana = new BitmapTextureAtlas(getTextureManager(), SPR_MC_RAHWANA_TEX_WIDTH,
				SPR_MC_RAHWANA_TEX_HEIGHT, Utils.getTextureOption());
		reg_Mc_Rahwana = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(tex_Mc_Rahwana, activity,
				SPR_MC_RAHWANA, 0, 0, SPR_MC_RAHWANA_COLUMN, SPR_MC_RAHWANA_ROW);
		tex_Mc_Rahwana.load();
		Utils.TRACE("Loadss MC Rahwana");
	}
	
	private void loadCelebrasiRahwana()
	{
		if (tex_Celebrasi_Rahwana != null)
			return;
		tex_Celebrasi_Rahwana = new BitmapTextureAtlas(getTextureManager(), SPR_CELEBRASI_RAHWANA_TEX_WIDTH,
				SPR_CELEBRASI_RAHWANA_TEX_HEIGHT, Utils.getTextureOption());
		reg_Celebrasi_Rahwana = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(tex_Celebrasi_Rahwana, activity,
				SPR_MC_CELEBRASI_RAHWANA, 0, 0, SPR_CELEBRASI_RAHWANA_COLUMN, SPR_CELEBRASI_RAHWANA_ROW);
		tex_Celebrasi_Rahwana.load();
	}
	
	private void loadCelebrasiRama()
	{
		if (tex_Celebrasi_Rama != null)
			return;
		tex_Celebrasi_Rama = new BitmapTextureAtlas(getTextureManager(), SPR_CELEBRASI_RAMA_TEX_WIDTH,
				SPR_CELEBRASI_RAMA_TEX_HEIGHT, Utils.getTextureOption());
		reg_Celebrasi_Rama = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(tex_Celebrasi_Rama, activity,
				SPR_MC_CELEBRASI_RAMA, 0, 0, SPR_CELEBRASI_RAMA_COLUMN, SPR_CELEBRASI_RAMA_ROW);
		tex_Celebrasi_Rama.load();
	}

}
